﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class PeiXunEmpDetailModel
    {
        /// <summary>
        /// 0为其他
        /// </summary>
        private int _EmpID = 0;
        [DataMember]
        public int EmpID
        {
            get { return _EmpID; }
            set { _EmpID = value; }
        }
        private int _Sec = 0;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _PeiXunID = 0;
        [DataMember]
        public int PeiXunID
        {
            get { return _PeiXunID; }
            set { _PeiXunID = value; }
        }

        private string _Memo ;
        [DataMember]
        public string Memo
        {
            get { return _Memo; }
            set { _Memo = value; }
        }
        private int _QiTaZhang = 0;
        [DataMember]
        public int QiTaZhang
        {
            get { return _QiTaZhang; }
            set { _QiTaZhang = value; }
        }

        private string _OrgName;
        [DataMember]
        public string OrgName
        {
            get { return _OrgName; }
            set { _OrgName = value; }
        }

        private string _EmpName;
        [DataMember]
        public string EmpName
        {
            get { return _EmpName; }
            set { _EmpName = value; }
        }

        private string _PeiXunName;
        [DataMember]
        public string PeiXunName
        {
            get { return _PeiXunName; }
            set { _PeiXunName = value; }
        }

        private string _JiangZuoType;
        [DataMember]
        public string JiangZuoType
        {
            get { return _JiangZuoType; }
            set { _JiangZuoType = value; }
        }

        private string _ZhuJiangRen;
        [DataMember]
        public string ZhuJiangRen
        {
            get { return _ZhuJiangRen; }
            set { _ZhuJiangRen = value; }
        }

        private string _JiangZuoShiJijan;
        [DataMember]
        public string JiangZuoShiJijan
        {
            get { return _JiangZuoShiJijan; }
            set { _JiangZuoShiJijan = value; }
        }

        private string _JiangZuoDiDian;
        [DataMember]
        public string JiangZuoDiDian
        {
            get { return _JiangZuoDiDian; }
            set { _JiangZuoDiDian = value; }
        }

        private int _OrgID = 0;
        [DataMember]
        public int OrgID
        {
            get { return _OrgID; }
            set { _OrgID = value; }
        }
        public static PeiXunEmpDetailModel FillEntity(DataRow dr)
        {
            PeiXunEmpDetailModel right = new PeiXunEmpDetailModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ID")) if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = Convert.ToInt32(dr["ID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("OrgID")) if (!string.IsNullOrEmpty(dr["OrgID"].ToString())) right.OrgID = Convert.ToInt32(dr["OrgID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) if (!string.IsNullOrEmpty(dr["Sec"].ToString())) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (dr.Table != null && dr.Table.Columns.Contains("PeiXunID")) if (!string.IsNullOrEmpty(dr["PeiXunID"].ToString())) right.PeiXunID = Convert.ToInt32(dr["PeiXunID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("EmpID")) if (!string.IsNullOrEmpty(dr["EmpID"].ToString())) right.EmpID = Convert.ToInt32(dr["EmpID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Memo")) if (!string.IsNullOrEmpty(dr["Memo"].ToString())) right.Memo = dr["Memo"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("QiTaZhang")) if (!string.IsNullOrEmpty(dr["QiTaZhang"].ToString())) right.QiTaZhang = Convert.ToInt32(dr["QiTaZhang"]);
            if (dr.Table != null && dr.Table.Columns.Contains("EmpName")) if (!string.IsNullOrEmpty(dr["EmpName"].ToString())) right.EmpName = dr["EmpName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("OrgName")) if (!string.IsNullOrEmpty(dr["OrgName"].ToString())) right.OrgName = dr["OrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiangZuoType")) if (!string.IsNullOrEmpty(dr["JiangZuoType"].ToString())) right.JiangZuoType = dr["JiangZuoType"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhuJiangRen")) if (!string.IsNullOrEmpty(dr["ZhuJiangRen"].ToString())) right.ZhuJiangRen = dr["ZhuJiangRen"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiangZuoShiJijan")) if (!string.IsNullOrEmpty(dr["JiangZuoShiJijan"].ToString())) right.JiangZuoShiJijan = dr["JiangZuoShiJijan"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiangZuoDiDian")) if (!string.IsNullOrEmpty(dr["JiangZuoDiDian"].ToString())) right.JiangZuoDiDian = dr["JiangZuoDiDian"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("PeiXunName")) if (!string.IsNullOrEmpty(dr["PeiXunName"].ToString())) right.PeiXunName = dr["PeiXunName"].ToString();
             return right;
        }
    }
}
